package com.luweijie.controller;

import com.luweijie.utils.JsonUtils;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class test {

     @PostMapping("/test")
    public String get(@RequestBody String body) {
         Map<String, Object> data = JsonUtils.stringToMap(body);
         String body1 = String.valueOf(data.get("body"));
         Map<String, Object> category = JsonUtils.stringToMap(body1);
         String category1 = String.valueOf(category.get("category"));
         Double quantity1 = Double.valueOf((Double) category.get("quantity"));
         System.out.println("ss = " + category1);
         System.out.println("ss = " + quantity1);

         return category1;
     }
}
